/**************************************************************************
 * Name         : ic2uf.h
 * Created      : 21/07/2005
 *
 * Copyright    : 2000-2005 by Imagination Technologies Limited. All rights reserved.
 *              : No part of this software, either material or conceptual 
 *              : may be copied or distributed, transmitted, transcribed,
 *              : stored in a retrieval system or translated into any 
 *              : human or computer language in any form by any means,
 *              : electronic, mechanical, manual or other-wise, or 
 *              : disclosed to third parties without the express written
 *              : permission of Imagination Technologies Limited, Unit 8, HomePark
 *              : Industrial Estate, King's Langley, Hertfordshire,
 *              : WD4 8LZ, U.K.
 *
 * Platform     : ANSI
 *
 * Modifications:-
 * $Log: ic2uf.h $
 **************************************************************************/
#ifndef __gl_ic2uf_h_
#define __gl_ic2uf_h_

#include "../glsl/glsl.h"
#include "../glsl/icode.h"
#include "glsl2uf.h"

/*
	Generate uniflex input code from an intermediate program
*/
GLSLUniFlexCode* GenerateUniFlexInput(GLSLCompilerPrivateData *psCPD, 
									  GLSLICProgram* psProgram,
									  GLSLBindingSymbolList **ppsBindingSymbolList);

/*
	Generate uniflex output code from uniflex input 
*/

#if defined(OUTPUT_USPBIN)
IMG_BOOL GenerateUniPatchInput(GLSLCompilerPrivateData *psCPD,
								GLSLUniFlexCode			*psUniFlexCode,
								IMG_VOID              *pvUniFlexContext,
								IMG_FLOAT			 *pfDefaultConstantData,
								GLSLProgramType		  eProgramType,
								GLSLProgramFlags	  *peProgramFlags,
								IMG_BOOL			  bCompileMSAATrans,
								GLSLUniFlexHWCodeInfo *psUniflexHWCodeInfo);
#else
IMG_BOOL GenerateUniFlexOutput(GLSLCompilerPrivateData *psCPD,
								GLSLUniFlexCode			*psUniFlexCode,
								IMG_VOID				*pvUniFlexContext,
								IMG_FLOAT				*pfDefaultConstantData,
								GLSLProgramType			eProgramType,
								GLSLUniFlexHWCodeInfo	*psUniflexHWCodeInfo);
#endif

/*
	Destroy uniflex code generated by GenerateUniFlextCode
*/
IMG_VOID DestroyUniFlexCode(GLSLCompilerPrivateData *psCPD,
							 IMG_VOID			*pvUniFlexContext,
							 GLSLUniFlexCode	*psUniFlexCode,
							 IMG_BOOL			bFreeUFInput,
							 IMG_BOOL			bFreeUFOutput);


IMG_VOID DumpUniFlextInstData(FILE *stream, IMG_VOID *pvCode);


IMG_VOID DestroyBindingSymbolList(GLSLBindingSymbolList *psBindingSymbolList);

#endif //__gl_ic2uf_h_
